import { EventNames } from "../consts/EventNames";
import Points from "../consts/Points";
import EventBus from "../core/EventBus";

export default class CallAction extends bt.Action {
    public static create(callback: Function): CallAction {
        return new CallAction(callback);
    }

    constructor(private callback: Function) {
        super();
    }

    execute(input: bt.BlackBoard): number {
        let res = this.callback();
        return res === "undefined" ? bt.State.success : res;
    }
}